<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 邮箱验证码接口
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\admin\model\UserModel;
use app\common\controller\Api;
use app\common\library\Wechat;
use think\Controller;
use think\Request;


class Index extends Api
{
    protected $noNeedLogin = ['*'];

    /*
     * 获取轮播图
     */

    public function getBanner(){
        $data = (new \app\common\model\BannerModel())->getBanner();

        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getNotice(){
        $data = (new \app\common\model\NoticeModel())->getList();
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getNoticeList(){
        $data = (new \app\common\model\NoticeModel())->getLists($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getDistricts(){
        $data = (new \app\common\model\DistrictsModel())->getDetail($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }


    public function getNoticeDetail(){
        $data = (new \app\common\model\NoticeModel())->getDetail($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

}
